package com.gopay.bis.pab.bcdl.impl;

import com.gopay.bis.pab.bcdl.operation.PabBcdlTransformer;
import com.gopay.bis.pab.bcdl.operation.PabBcdlTransport;
import com.gopay.common.domain.bank.pab.bcdl.PABOnlineMessage;
import com.gopay.common.exception.GopayException;
import com.gopay.remote.bank.businesses.BcdlService;

/**
 *  平安银行银企直连实现
 *	
 *  关于银行返回000000平台处理逻辑：行内000000代表已入账，跨行仅代表本行受理成功，具体是否入收款行客户帐需要看收款行处理情况
 *  新平台处理逻辑：不管行内或者跨行，只要银行返回000000，均代表成功
 * 
 * @author WangHongFei
 * 
 */
public class PabBcdlServiceImpl implements BcdlService {
	
	private PabBcdlTransformer pabBcdlTransformer;
	private PabBcdlTransport pabBcdlTransport;
	
	public Object query(Object message) throws GopayException{
		PABOnlineMessage pab = (PABOnlineMessage)message;
		String xmlStr = pabBcdlTransformer.format(pab);
		Object receivedMsgData = pabBcdlTransport.submit(xmlStr);
		return pabBcdlTransformer.parse(receivedMsgData);
	}

	public Object eft(Object message) throws GopayException{
		PABOnlineMessage pab = (PABOnlineMessage)message;
		String xmlStr = pabBcdlTransformer.format(pab);
		Object receivedMsgData = pabBcdlTransport.submit(xmlStr);
		return pabBcdlTransformer.parse(receivedMsgData);
	}

	public void setPabBcdlTransformer(PabBcdlTransformer pabBcdlTransformer) {
		this.pabBcdlTransformer = pabBcdlTransformer;
	}

	public void setPabBcdlTransport(PabBcdlTransport pabBcdlTransport) {
		this.pabBcdlTransport = pabBcdlTransport;
	}

    @Override
    public Object queryBalance(Object object) throws GopayException {
        // TODO Auto-generated method stub
        return null;
    }

	@Override
	public Object packetEft(Object object) throws GopayException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object queryPacket(Object object) throws GopayException {
		// TODO Auto-generated method stub
		return null;
	}

    @Override
    public Object queryAcctDetail(Object object) throws GopayException {
        // TODO Auto-generated method stub
        return null;
    }
	
}